home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8981 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: watnews.watson.ibm.com!ncohen
  2. From: ncohen@watson.ibm.com (Norman H. Cohen)
  3. Newsgroups: comp.lang.ada,comp.lang.c++
  4. Subject: Re: on OO differnces between Ada95 and C++
  5. Date: 27 Feb 1996 18:55:07 GMT
  6. Organization: IBM T.J. Watson Research Center
  7. Distribution: world
  8. Message-ID: <4gvk2b$sjq@watnews1.watson.ibm.com>
  9. References: <4gbq7q$g08@qualcomm.com> <Dn4J2F.uI@bton.ac.uk> <4gh204$l7n@qualcomm.com> <DnDuA4.8GC@bton.ac.uk>
  10. Reply-To: ncohen@watson.ibm.com
  11. NNTP-Posting-Host: rios8.watson.ibm.com
  12.  
  13. In article <DnDuA4.8GC@bton.ac.uk>, je@bton.ac.uk (John English) writes: 
  14.  
  15. |> Nasser Abbasi (nabbasi@qualcomm.com) wrote: 
  16. ...
  17. |> : If what you say was the case, then types defined in package "A"
  18. |> : will be seen by clients to a package "B" where "B" has with'ed A. But
  19. |> : it is not so. Clients of "B" must also 'with' "A" to see types defined
  20. |> : in "A" even though "B: has allready  with'ed "A".
  21. |>
  22. |> If you're right this would be a real pain.
  23.  
  24. But he is, and it isn't.
  25.  
  26. |>                                             Clients of a package would have
  27. |> to know (recursively) what other packages the spec(s) reference; if the
  28. |> spec for X "withs" a package Y so it can use type Y.T as a procedure
  29. |> parameter then you wouldn't be able to use X without Y (i.e. "with X"
  30. |> on its own would be useless; you'd have to have "with X, Y" and probably
  31. |> other things as well if Y has any "with" clauses in its specification.
  32.  
  33. If a client of X has a with clause for Y, it is not because X has a with
  34. clause for Y, but because the client itself is using a facility provided
  35. by Y.  Specifically, if the client calls your procedure with a parameter
  36. of type Y.T, then it is using that type.  If X's client does not call
  37. that procedure, it may not need a with clause for Y.
  38.  
  39. Furthermore, for the convenience of its clients, X can contain a
  40. declaration such as
  41.  
  42.    subtype T is Y.T;
  43.  
  44. which causes X to reexport the type originally declared in Y.  Then X's
  45. client can refer to the type (as X.T) without a with clause for Y.
  46.  
  47. --
  48. Norman H. Cohen    ncohen@watson.ibm.com
  49.